//
// Created by Xiaoyun on 2023/3/21.
//

#ifndef FOC_LED_H
#define FOC_LED_H

#include <stdint.h>

#ifndef __weak
#define __weak   __attribute__((weak))
#endif

typedef struct {
  uint8_t R;  //Red(0-255)
  uint8_t G;  //Green(0-255)
  uint8_t B;  //Blue(0-255)
} RGB_t;

typedef struct {
  uint8_t H;  //Hue(0-179)
  uint8_t S;  //Saturation(0-255)
  uint8_t V;  //Value(0-255)
} HSV_t;

void LED_Init();

//RGB(Red, Green, Blue) Color Model

void LED_Set_RGB(uint8_t R, uint8_t G, uint8_t B);

void LED_Set_RGB_t(RGB_t RGB);

void LED_Get_RGB_t(RGB_t* RGB);

//HSV(Hue, Saturation, Value) Color Model

void LED_Set_HSV(uint8_t H, uint8_t S, uint8_t V);

void LED_Set_HSV_t(HSV_t HSV);

void LED_Get_HSV_t(HSV_t* HSV);

//Color Model Conversion

void HSV_t2RGB_t(HSV_t HSV, RGB_t *RGB);

void RGB_t2HSV_t(RGB_t RGB, HSV_t *HSV);

#endif //FOC_LED_H
